﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace zielonka.co.uk.extensions.system
{
    //Description:	Converts string to a title case.
    /*
        sint x=s.GetWordCount();
    */

    public static partial class StringExtensions
    {
        /// <summary>
        /// Removes all HTML tags from string.
        /// </summary>
        /// <param name="html">String containing HTML tags.</param>
        /// <returns>String with no HTML tags.</returns>
        public static string StripHTML(this string html)
        {
            string nohtml = Regex.Replace(html, "<(.|\n)*?>", "");
            nohtml = nohtml.Replace("\r\n", "").Replace("\n", "").Replace("&nbsp;", "").Trim();
            return nohtml;
        }
    }
}
